package com.atguigu.jxc.controller;

import com.atguigu.jxc.service.UnitService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * ClassName: UnitController
 * Package: com.atguigu.jxc.controller
 *
 * @Description:
 * @Author: xvyy
 * @Create: 2025/2/21 - 17:00
 * @Version: v1.0
 */
@RestController
@RequestMapping("/unit")
public class UnitController {


    @Autowired
    private UnitService unitService;


    /**
     * 查询所有单位
     *
     * @return Map<String, Object> 返回单位列表
     */
    @PostMapping("/list")
    @RequiresPermissions(value = "商品管理")
    public Map<String, Object> list() {
        return unitService.list();
    }

}
